package com.axjy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.axjy.mapper.MedicineMapper;
import com.axjy.pojo.Medicine;
import com.axjy.service.MedicineService;
import com.axjy.util.Pager;

@Service("medicineService")
@Transactional
public class MedicineServiceImpl implements MedicineService {

	@Resource
	private MedicineMapper medicineMapper;
	
	/*@Override
	public Medicine searchByyaoInfo(String id) {
		return medicineMapper.get(id);
	}

	@Override
	public Pager<Medicine> searchHospitalPager(Pager<Medicine> pager) {
		pager.setRows(medicineMapper.searchHospitalPager(pager));
		int totl=medicineMapper.total(pager);
		System.out.println(totl);
		pager.setTotal(totl);
		return pager;
	}*/

	@Transactional(readOnly = true)
	public List<Medicine> list() {
		return medicineMapper.list();
	}

	@Override
	public int add(Medicine med) {
		// TODO Auto-generated method stub
		return medicineMapper.add(med);
	}
	
}
